package ooday02;

public class OverrideDemo {
    public static void main(String[] args) {
        //重写方法被调用是，看对象的类型来执行方法(new谁就调谁)
        Studnet zg=new Studnet("李林",22,"南昌","jsd","008");
        zg.sayHI(); //调用Student类重写之后的

        Teacher ll =new Teacher("赵亮",36,"山东",6000.0);
        ll.sayHI();//调用Teacher类重写之后的


        Doctoe zl =new Doctoe("王鹏飞",45,"山西","主治医师");
        zl.sayHI();//调用Person类
    }
}
